Skip to content

Comments

fix(NKFile+Extensions): prevent __NC_ROOT__ from appearing#128

Merged
mgallien merged 1 commit intomainfrom
bugfix/desktop-8832/nk-rootfilename
Oct 6, 2025
Merged

fix(NKFile+Extensions): prevent __NC_ROOT__ from appearing#128
mgallien merged 1 commit intomainfrom
bugfix/desktop-8832/nk-rootfilename

Conversation

@nilsding
Copy link
Member

@nilsding nilsding commented Oct 6, 2025

With nextcloud/NextcloudKit#169 the sync root folder name has changed. This required consumers of the API to update the handling of the root folder case accordingly.

I am not 100% sure if the fix is correct, but at least the folder no longer shows up on a local build, and the tests are happy after updating them again to replicate NextcloudKit's behaviour as well.

Part of nextcloud/desktop#8832

With nextcloud/NextcloudKit#169 the sync root folder name has changed.
This required consumers of the API to update the handling of the root
folder case accordingly.

BUG: nextcloud/desktop#8832
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
@nilsding nilsding requested review from Copilot and i2h3 October 6, 2025 11:27
@nilsding nilsding self-assigned this Oct 6, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the handling of Nextcloud's root folder representation by updating code to use the new __NC_ROOT__ filename convention instead of the previous "." convention, following changes in NextcloudKit #169.

  • Updates root folder detection logic to use NextcloudKit's new root filename constant
  • Replaces hardcoded root folder identifiers with proper server URL construction
  • Updates test cases to reflect the new root folder naming convention

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Sources/NextcloudFileProviderKit/Extensions/NKFile+Extensions.swift Updates root folder detection logic to use NextcloudKit's rootFileName constant and proper server URL construction
Sources/NextcloudFileProviderKit/Enumeration/Enumerator+SyncEngine.swift Updates file filtering condition to use new root folder identification method
Tests/NextcloudFileProviderKitTests/NKFileExtensionTests.swift Updates test cases to use new root folder filename and server URL format
Tests/InterfaceTests/MockRemoteInterfaceTests.swift Updates test assertions to expect new root folder naming convention
Tests/Interface/MockRemoteItem.swift Updates mock implementation to generate NKFile objects with new root folder format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mgallien mgallien merged commit 0864b0d into main Oct 6, 2025
2 checks passed
@mgallien mgallien deleted the bugfix/desktop-8832/nk-rootfilename branch October 6, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants